---OOSE SoSe 2011 Aufgabe 3
--@author Oleg Mayevskiy <mayevskiy.oleg@googlemail.com> (233197)
require('classes')

Class{'Logger', level = Number,
	SEVERE = 1,
	WARNING = 10,
	INFO = 100,
	FINE = 1000,
	FINER = 10000,
	FINEST = 100000

	}

function Logger:names()
	return {
	[1]="SEVERE",
	[10]="WARNING",
	[100]="INFO",
	[1000]="FINE",
	[10000]="FINER",
	[100000]="FINEST"
	}
end

function Logger:log(logLevel, ...)
	if (not isNil(self.level) and self.level >= logLevel) then
		print(self:names()[logLevel],':',unpack(arg))
	end
end

function Logger:severe(...)
	self:log(self.SEVERE,unpack(arg))
end

function Logger:warning(...)
	self:log(self.WARNING,unpack(arg))
end

function Logger:info(...)
	self:log(self.INFO,unpack(arg))
end

function Logger:fine(...)
	self:log(self.FINE,unpack(arg))
end

function Logger:finer(...)
	self:log(self.FINER,unpack(arg))
end

function Logger:finest(...)
	self:log(self.FINEST,unpack(arg))
end




